// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import "./assets/css/comm.css"
import "./assets/css/reset.css"
import './utils/flexible.js'
import animated from 'animate.css'
import VueScrollReveal from 'vue-scroll-reveal';
import VueDirectiveImagePreviwer from "vue-directive-image-previewer"
import "vue-directive-image-previewer/dist/assets/style.css"
import 'vue-awesome-swiper/node_modules/swiper/dist/css/swiper.css'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import i18n from './i18n';
// import VConsole from 'vconsole'
// const vConsole = new VConsole()
// Vue.use(vConsole)
Vue.use(VueAwesomeSwiper)
Vue.use(VueDirectiveImagePreviwer, {
    background: { // or : background: '#000'
        color: '#000' // or rgba or rgb     // or image: 'url(xxx)'
    },
    // transition
    animate: {
        duration: 600,
        delay: 500
    },
    // loading (not supported)
    loading: {
        image: ''
    },
    previewSize: 3,
    // cursor(css)
    cursor: 'pointer',
    clickMethod: 'doubleClick' // click or doubleClick(not supported)
})
Vue.use(VueScrollReveal, {
    class: 'v-scroll-reveal',
    duration: 2000,
    scale: 1,
    distance: '50px',
    mobile: true,
    easing: "ease-in-out",
    origin: "bottom",

});
Vue.use(animated)
Vue.config.productionTip = false
router.afterEach((to, from, next) => {
    window.scrollTo(0, 0);
})
router.beforeEach((to, from, next) => {
        // to来自  from  去哪
        if (to.meta.title) {
            document.title = to.meta.title
        }
        next()
    })
    /* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    i18n,
    components: { App },
    template: '<App/>',
    mounted() {
        document.dispatchEvent(new Event('render-event'));
    }
})